package com.zretc.entity;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

public class Pig implements InitializingBean,DisposableBean,BeanNameAware,BeanFactoryAware {
	
	private String name;
	
	public Pig() {
		System.out.println("**************pig的构造方法**************");
	}

	
	@Override
	public String toString() {
		return "Pig [name=" + name + "]";
	}


	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		System.out.println("**************pig的setName方法**************");
		this.name = name;
	}
	
	public void objdestroy()
	{
		System.out.println("**************pig的objdestroy方法**************");
	}
	
	public void objinit() {
		System.out.println("**************pig的objinit方法**************");
	}

	
	@Override
	public void afterPropertiesSet() throws Exception {
		System.out.println("**************InitializingBean的afterPropertiesSet属性设置完成方法**************");
		
	}
	
	@Override
	public void destroy() throws Exception {
		System.out.println("**************DisposableBean的destroy属性设置完成方法**************");
		
	}
	
	@Override
	public void setBeanName(String arg0) {
		System.out.println("**************setBeanName :"+arg0+"**************");
		
	}
	
	@Override
	public void setBeanFactory(BeanFactory arg0) throws BeansException {
		System.out.println("**************setBeanFactory :"+arg0+"**************");
		
		
	}
}
